# $ID$
# Maintainer: Rémy Oudompheng <remy@archlinux.org>

pkgname=perl-xml-libxml-simple
_dist=XML-LibXML-Simple
pkgver=1.01
pkgrel=2
pkgdesc="An analogue of XML::Simple using libxml"
arch=('any')
url="https://metacpan.org/release/${_dist}"
license=('PerlArtistic' 'GPL')
depends=('perl' 'perl-xml-libxml' 'perl-file-slurp-tiny')
options=('!emptydirs')
source=(https://search.cpan.org/CPAN/authors/id/M/MA/MARKOV/${_dist}-${pkgver}.tar.gz)
sha256sums=('cd98c8104b70d7672bfa26b4513b78adf2b4b9220e586aa8beb1a508500365a6')

build() {
    cd "${srcdir}/${_dist}-${pkgver}"
    unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
    export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
    perl Makefile.PL
    make
}

check() {
    cd "${srcdir}/${_dist}-${pkgver}"
    unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
    export PERL_MM_USE_DEFAULT=1
    make test
}

package() {
    cd "${srcdir}/${_dist}-${pkgver}"
    unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
    make install INSTALLDIRS=vendor DESTDIR="$pkgdir"
}
